<%
Dim xmlDoc, rootEl, child1, child2, p
if(request("message")<>"" & request("location")<>"") then
'创建XML文档
Dim xml
Set xml= Server.CreateObject("Microsoft.XMLDOM")
xml.async=False
xml.load(Server.MapPath("data.xml"))

Dim message,location,postTime
message=request("message")
location=request("location")
postTime=Date()

'创建根元素并将之加入文档
Dim root
Set root=xml.documentElement
Set newdata=xml.createNode("element","mapdata","")

'创建并加入子元素
Dim newMessage,newLocation,newTime
Set newMessage=xml.createNode("element","message","")
newMessage.text=message

Set newLocation=xml.createNode("element","location","")
newLocation.text=location

Set newTime=xml.createNode("element","time","")
newTime.text=postTime

newdata.appendChild(newMessage)
newdata.appendChild(newLocation)
newdata.appendChild(newTime)

root.appendChild(newdata)
xml.save(Server.Mappath("data.xml"))
end if
%>